package com.pesilo.mvc.controller
{
	import com.pesilo.mvc.model.BackgroundProxy;
	import com.pesilo.mvc.model.WeatherDataProxy;
	import com.pesilo.mvc.view.ApplicationMediator;
	
	import org.puremvc.as3.multicore.interfaces.INotification;
	import org.puremvc.as3.multicore.patterns.command.SimpleCommand;

	public class ApplicationStartupCommand extends SimpleCommand
	{
		override public function execute(notification:INotification):void{
			facade.registerProxy(new BackgroundProxy());
			facade.registerProxy(new WeatherDataProxy());
			
			facade.registerMediator(new ApplicationMediator(notification.getBody()));
			
			(facade.retrieveProxy(BackgroundProxy.NAME) as BackgroundProxy).getBackgroundData();
			(facade.retrieveProxy(WeatherDataProxy.NAME)as WeatherDataProxy).getWeatherData();
		}
	}
}